<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>目标伪类选择器</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style: none;
            position: fixed;
            right: 20px;
            top: 50%;
            margin-top: -250px;
            width: 100px;
            height: 250px;
            background: yellow;
        }
        li{
            margin-top: 35px;
            text-align: center;
        }
        #box1{
            height: 800px;
            background: red;
        }
        #box2{
            height: 800px;
            background: green;
        }
        #box3{
            height: 800px;
            background: blue;
        }
        #box4{
            height: 800px;
            background: rgb(9, 241, 164);
        }
        div:target{
            font-size: 50px;
            color: gold;
            font-weight: bold;
        }
    </style>
</head>
<body>
    <div id="box1">特色优选</div>
    <div id="box2">频道广场</div>
    <div id="box3">为你推荐</div>
    <div id="box4">猜你喜欢</div>
    <ul>
        <li><a href="#box1">特色优选</a#></li>
        <li><a href="#box2">频道广场</a#></li>
        <li><a href="#box3">为你推荐</a#></li>
        <li><a href="#box4">猜你喜欢</a#></li>
    </ul>
</body>
</html>